<!DOCTYPE html>
<html>
    <head>
        <? require_once 'header.php'; ?>
    </head>
    <body>
        <?php
        getNavbar();
        ?>
        <div class="container-fluid" style="margin-top: 60px;">
            <div class="row-fluid">
                <div class="span3 container">
                    <div class="navbar">
                        <div class="navbar-inner">
                            <a class="brand" href="">Republicas cadastradas</a>
                        </div>
                        <div class="container well">
                            <? Visual::getRepublicaVertical(); ?>
                        </div>
                    </div>
                </div>
                <div class="span6 container">
                    <div class="navbar">
                        <div class="navbar-inner">
                            <ul class="nav">
                                <li class="active"><a href="#cadastroRepublica" data-toggle="tab"><i class="icon-home"></i>Republica</a></li>

                            </ul>
                        </div>
                        <div class="container well">
                            <div class="tab-content">
                                <div class="tab-pane active" id="cadastroRepublica">
                                    <form class="form-horizontal" method="POST" action="" enctype="multipart/form-data">
                                        <input type="hidden" id="formCadastroRepublica" name="formCadastroRepublica" value="formCadastroRepublica"/>
                                        <input type="hidden" id="codUsuario" name="codUsuario" value="<? echo $this->getUsuario()->getCodigo(); ?>"/>
                                        <div class="control-group">
                                            <label class="control-label" for="edtNome">Nome da Republica</label>
                                            <div class="controls">
                                                <input type="text" id="edtNome" name="edtNome" placeholder="Nome da Republica" required=""/>
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label" for="edtVagas">Quantidade de Vagas</label>
                                            <div class="controls">
                                                <input type="text" id="edtVagas" name="edtVagas" placeholder="01" onkeypress="mascaraInteiro(this);" required />
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label" for="edtTipo">Tipo</label>
                                            <div class="controls">
                                                <select id="edtTipo" name="edtTipo">
                                                    <option value="Mista" selected="true">Mista</option>
                                                    <option value="Masculina">Masculina</option>
                                                    <option value="Feminina">Feminina</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label" for="edtDescricao">Descricão</label>
                                            <div class="controls">
                                                <textarea id="edtDescricao" name="edtDescricao" required=""></textarea>
                                            </div>
                                        </div>

                                        <div class="control-group">
                                            <label class="control-label" for="edtPais">Pais</label>
                                            <div class="controls">
                                                <select id="edtPais" name="edtPais">
                                                    <?
                                                    $dp = new DAOPais();
                                                    $paises = $dp->getPaises();
                                                    foreach ($paises as $pais) {
                                                        ?>
                                                        <option value="<?php echo $pais->getCodigo(); ?>" <?php if ($pais->getCodigo() == 1) { ?> selected="true"<?php } ?>><?php echo $pais->getNome(); ?></option>
                                                        <?php
                                                    }
                                                    ?>

                                                </select>
                                                <!--<input type="text" id="edtPais" name="edtPais" placeholder="Pais">-->
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label" for="edtEstado">Estado</label>
                                            <div class="controls">
                                                <select id="edtEstado" name="edtEstado" onchange="buscar_cidades();" required="required">
                                                    <option value="">Selecione</option>
                                                    <?
                                                    $de = new DAOEstado();
                                                    $estados = $de->getEstados();
                                                    foreach ($estados as $es) {
                                                        ?>
                                                        <option value="<?php echo $es->getCodigo(); ?>"><?php echo $es->getNome(); ?></option>
                                                        <?php
                                                    }
                                                    ?>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label" for="edtCidade">Cidade</label>
                                            <div class="controls" id="cidade">
                                                <select id="edtCidade" name="edtCidade" required="required">
                                                    <option value="">Selecione o estado</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label" for="edtBairro">Bairro</label>
                                            <div class="controls">
                                                <input type="text" id="edtBairro" name="edtBairro" placeholder="Bairro" required="">
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label" for="edtEndereco">Endereço</label>
                                            <div class="controls">
                                                <input type="text" id="edtEndereco" name="edtEndereco" placeholder="Endereço" required="">
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label" for="edtNumero">Número</label>
                                            <div class="controls">
                                                <input type="text" id="edtNumero" name="edtNumero" placeholder="Número" onkeypress="mascaraInteiro(this);" required="">
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label" for="edtImagemRepublica">Imagem Principal</label>
                                            <div class="controls">
                                                <input type="file" id="edtImagemRepublica" name="edtImagemRepublica">
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <label class="control-label" for="edtImagensRepublica">Outras Imagens</label>
                                            <div class="controls">
                                                <input type="file" multiple="multiple" id="edtImagensRepublica" name="edtImagensRepublica[]">
                                            </div>
                                        </div>
                                        <div class="control-group">
                                            <div class="controls">
                                                <button type="submit" class="btn">Cadastrar</button>
                                            </div>
                                        </div>
                                    </form>
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
                <div class="span3 container">
                    <div class="navbar">
                        <div class="navbar-inner">
                            <a class="brand" href="">Eventos mais acessados</a>
                        </div>
                        <div class="container well">
                            <?
                            Visual::getEventosVertical();
                            ?>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <?
        require_once 'footer.php';
        ?>
    </body>
</html>
